<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="abc">不第后赋菊</div>
    <ul>
        <li>待到秋来九月八，</li>
        <li>我花开后百花杀。</li>
        <li>冲天香阵透长安，</li>
        <li>满城尽带黄金甲。</li>
    </ul>
    <ol id="wr">
        <li>周杰伦</li>
        <li>诸葛亮</li>
        <li>虞姬</li>
    </ol>
    <script>
        /*
          document.getElementsByTagName('li')
          获取document所有的 li 标签，返回下的一个(伪)数组

          对象名.getElementsByTagName('li')
          获取 对象内的所有的 元素
        */
        var div = document.getElementById('abc');
        console.log(div);
        var lis = document.getElementsByTagName('li');
        console.log(lis);
        for (var i = 0; i < lis.length; i++){
            console.log(lis[i]);
        }
        console.log('--------------------------');
        var ol = document.getElementById('wr');
        console.log(ol);
        var lis2 = ol.getElementsByTagName('li');
        console.log(lis2);

    </script>
</body>
</html>